import zhreq from "@/api/axios";
export default {
  // --- 手机端相关---
  getallappmenulist() {
    return zhreq.post("organizationManage/appRoute/queryByCondition", {
      // "systemMark": "SC",
      "organizationNo": sessionStorage.getItem("organizationNo")
    })
  },
  gethasappmenulist(params) {
    return zhreq.post("organizationManage/appUserRouteMapper/queryByCondition", params)
  },
  saveappmenulist(params) {
    return zhreq.post("organizationManage/appUserRouteMapper/add", params)
  },
  // ---end---
  // ----所有菜单---
  getallmenulist() {
    return zhreq.post("powerManage/route/queryAllRouteTreeList", {
      // "systemMark": "SC",
      "organizationNo": sessionStorage.getItem("organizationNo")
    })
  },
  // ---------角色相关 ----------
  /**
     * @description: 获取已配置路由树
     * @return {Object}
     */
  getrolelist(id) {
    return zhreq.post("powerManage/roleRouteMapper/queryByCondition", {
      "roleId": id,
      // "systemMark": "SC",
      "organizationNo": sessionStorage.getItem("organizationNo")
    });
  },
  /**
     * @description: 获取未配置路由树
     * @return {Object}
     */
  noconfiggetrolelist(params) {
    return zhreq.post("powerManage/dataMonitor/queryPageList", {
      ...params
    });
  },
  /**
     * @description: 新增
     * @return {Object}
     */
  addrolelist(params) {
    return zhreq.post("powerManage/roleRouteMapper/add", {
      ...params
    });
  },
  /**
     * @description: 删除
     * @return {Object}
     */
  delrolelist(params) {
    return zhreq.post("powerManage/roleRouteMapper/delList", {
      dataMonitorIdList: params
    });
  },
  /**
   * @description: 直接获取所有可配置角色
   * @param {String} organizationtId
   * @return {Array}
   */
  getroleAll() {
    return zhreq.post("powerManage/role/queryByCondition", {
      "organizationNo": sessionStorage.getItem("organizationNo"),
      "systemMark": "SC"
    })
  },
  // ---------用户相关 ----------
  /**
     * @description: 获取已配置路由树
     * @return {Object}
     */
  getuserlist(id) {
    return zhreq.post("powerManage/userRouteMapper/queryByCondition", {
      "userId": id,
      // "systemMark": "SC",
      "organizationNo": sessionStorage.getItem("organizationNo")
    });
  },
  /**
     * @description: 获取未配置路由树
     * @return {Object}
     */
  noconfiggetuserlist(params) {
    return zhreq.post("powerManage/dataMonitor/queryPageList", {
      ...params
    });
  },
  /**
     * @description: 新增
     * @return {Object}
     */
  adduserlist(params) {
    return zhreq.post("powerManage/userRouteMapper/add", {
      ...params
    });
  },
  /**
     * @description: 删除
     * @return {Object}
     */
  deluserlist(params) {
    return zhreq.post("powerManage/dataMonitor/delList", {
      dataMonitorIdList: params
    });
  },
  /**
   * @description: 直接获取所有可配置角色
   * @param {String} organizationtId
   * @return {Array}
   */
  getuserAll() {
    return zhreq.post("powerManage/user/queryByCondition", {
      "organizationNo": sessionStorage.getItem("organizationNo"),
      "systemMark": "SC"
    })
  },
  // ---------农业类型相关 ----------
  /**
     * @description: 获取已配置路由树
     * @return {Object}
     */
  getfarmingTypelist(id) {
    return zhreq.post("powerManage/farmingTypeRoutMapper/queryByCondition", {
      // "farmingType": sessionStorage.getItem("farmingTypeNo"),
      // "userId": sessionStorage.getItem("organizationNo"),
      // "systemMark": "SC",
      "farmingTypeNo": id,
      "organizationNo": sessionStorage.getItem("organizationNo")
    });
  },
  /**
     * @description: 获取未配置路由树
     * @return {Object}
     */
  noconfiggetfarmingTypelist(params) {
    return zhreq.post("powerManage/dataMonitor/queryPageList", {
      ...params
    });
  },
  /**
     * @description: 新增
     * @return {Object}
     */
  addfarmingTypelist(params) {
    return zhreq.post("powerManage/farmingTypeRoutMapper/add", {
      ...params
    });
  },
  /**
     * @description: 删除
     * @return {Object}
     */
  delfarmingTypelist(params) {
    return zhreq.post("powerManage/dataMonitor/delList", {
      dataMonitorIdList: params
    });
  }
}
